﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "GcmpModelInterface.h"
#include "IEvent.h"
namespace gcmp
{
    class ElementLocator;
    class IElementLocatorPositionChangeEventHandler;
    /// \brief 罗盘位置变化事件接口类
    ///
    /// 负责发送罗盘位置变化事件
    class GCMP_MODEL_INTERFACE_EXPORT IElementLocatorPositionChangeEvent : public IEvent 
    {
        DEFINE_CAST_DERIVED(gcmp::IElementLocatorPositionChangeEvent, gcmp::IEvent);
    public:
        /// \brief 添加事件处理者
        /// \param pHandler 事件处理者
        /// \return 返回true表示添加成功，否则表示失败
        virtual bool Add(IElementLocatorPositionChangeEventHandler* pHandler) = 0;

        /// \brief 删除事件处理者
        /// \param pHandler 事件处理者
        /// \return 返回true表示删除成功，否则表示失败
        virtual bool Delete(IElementLocatorPositionChangeEventHandler* pHandler) = 0;

        /// \brief 得到消息发送者
        /// \return 消息发送者
        virtual ElementLocator* GetSender() const = 0;
    };
}


